/**
 * Project oo_thread
 */


#ifndef _TASKQUEUE_H
#define _TASKQUEUE_H
#include <queue>
#include "Mutex.h"
#include "Condition.h"
#include "Task.h"
using std::queue;
class TaskQueue {
public: 
    
/**
 * @param size
 */
TaskQueue(size_t size);
    
Task * pop();
bool empty();
bool full();
void wakeup();
    
/**
 * @param int
 */
void push(Task *task);
private: 
    size_t _queSize;
    queue<Task *> _que;
    Mutex _mutex;
    Condition _notEmpty;
    Condition _notFull;
    bool _flag;
};

#endif //_TASKQUEUE_H
